package com.ssy.lingxi.member.merchant.entity;

import com.ssy.lingxi.member.merchant.handler.converter.JpaJsonToMapConverter;
import lombok.Data;

import javax.persistence.*;
import java.util.HashMap;

/**
 * 实名验证配置类
 * @author lqa
 * @version 2.0.0
 * @date 2022/1/12
 */

@Data
@Entity
@Table(schema = "public", name = "ms_mc_member_auth_type_config",
        uniqueConstraints = {@UniqueConstraint(columnNames = {"authType"})},
        indexes = {@Index(name = "member_auth_type_config_status_idx", columnList = "status")})
public class MemberAuthTypeConfigDO {
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="member_auth_type_config_seq")
    @SequenceGenerator(sequenceName="ms_mc_member_auth_type_config_seq", name="member_auth_type_config_seq",allocationSize = 1)
    private Long id;

    /**
     * 其他资料-Json格式
     */
    @Convert(converter = JpaJsonToMapConverter.class)
    @Column(columnDefinition="jsonb")
    private HashMap<String,Object> config;

    /**
     * 实名验证类型: 1-百度
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer authType;

    /**
     * 是否启用
     */
    @Column(columnDefinition = "boolean", nullable = false)
    private Boolean status = true;

}
